🔙 Home

1 Set up

library(tidyverse)
## ── Attaching packages ─────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
## ✔ ggplot2 3.2.1     ✔ purrr   0.3.3
## ✔ tibble  2.1.3     ✔ dplyr   0.8.4
## ✔ tidyr   1.0.2     ✔ stringr 1.4.0
## ✔ readr   1.3.1     ✔ forcats 0.4.0
## ── Conflicts ────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library(ggchicklet)
library(gganimate)

2 Known stats

fixed_term_NCL <- .41
fixed_term_all <- .33
job_ads_TSft_NCL <- 230
job_ads_TR_NCL <- 85
employees_NCL_TSft <- .73
employees_NCL_TSoe <- .20

data <- read_csv("data/UCU-hesa-table-7.csv",
                 col_names = TRUE,
                 comment = "#")
## Parsed with column specification:
## cols(
##   UKPRN = col_double(),
##   `HE provider` = col_character(),
##   `Country of HE provider` = col_character(),
##   `Region of HE provider` = col_character(),
##   `Mode of employment` = col_character(),
##   `Activity standard occupational classification` = col_character(),
##   `Academic Year` = col_character(),
##   `Category Marker` = col_character(),
##   Category = col_character(),
##   Number = col_double()
## )

3 Plots

tibble(fixed_term_all,fixed_term_NCL) %>% 
  pivot_longer(names_to = "fixed_term",
               values_to = "percent",
               cols = c(1:2)) %>% 
  mutate(fixed_term = case_when(fixed_term == "fixed_term_all" ~ "Sector-wide",
                                fixed_term == "fixed_term_NCL" ~ "Newcastle U.")) %>% 
  ggplot(aes(x=fixed_term,y=percent,fill=fixed_term, colour=NULL)) +
  geom_chicklet(radius = grid::unit(1, 'mm')) +
  geom_bar(stat="identity",
           aes(x=fixed_term, y=percent-.1, fill=fixed_term),
           width = .88) +
  scale_y_continuous(labels = scales::percent_format(),
                     limits = c(0,1)) +
  annotate(geom = "text", x = 1.01:2.01, y = c(.1,.1), 
           label=c("41%","33%"),
           size=5,
           colour="white") +
  scale_fill_manual(values = c("violetred2","mediumpurple4"),
                    guide = FALSE) + #darkorchid4; purple4
  scale_colour_manual(values = c("violetred2","mediumpurple4"),
                    guide = FALSE) +
  xlab("") +
  ylab("percent of academics employed fixed-term") +
  theme_bw()

tibble(job_ads_TSft_NCL,job_ads_TR_NCL) %>% 
  pivot_longer(names_to = "job_ads",
               values_to = "percent",
               cols = c(1:2)) %>% 
  mutate(job_ads = case_when(job_ads == "job_ads_TR_NCL" ~ "\nT&R posts",
                             job_ads == "job_ads_TSft_NCL" ~ "T&S fixed-term posts")) %>% 
  ggplot(aes(x=job_ads,y=percent,fill=job_ads, colour=NULL)) +
  geom_chicklet(radius = grid::unit(1, 'mm')) +
  geom_bar(stat="identity",
           aes(x=job_ads, y=percent-10, fill=job_ads),
           width = .881) +
  scale_y_continuous(limits = c(0,250)) +
  annotate(geom = "text", x = 1.01:2.01, y = c(10,10), 
           label=c("85","230"),
           size=5,
           colour="white") +
  scale_fill_manual(values = c("violetred2","mediumpurple4"),
                    guide = FALSE) + #darkorchid4; purple4
  scale_colour_manual(values = c("violetred2","mediumpurple4"),
                    guide = FALSE) +
  xlab("") +
  ylab("total advertised posts (2017/18)") +
  theme_bw()

tibble(employees_NCL_TSft,employees_NCL_TSoe) %>% 
  pivot_longer(names_to = "TnS",
               values_to = "percent",
               cols = c(1:2)) %>% 
  mutate(TnS = case_when(TnS == "employees_NCL_TSft" ~ "Fixed-term",
                         TnS == "employees_NCL_TSoe" ~ "Open-ended")) %>% 
  ggplot(aes(x=TnS,y=percent,fill=TnS, colour=NULL)) +
  geom_chicklet(radius = grid::unit(1, 'mm')) +
  geom_bar(stat="identity",
           aes(x=TnS, y=percent-.1, fill=TnS),
           width = .881) +
  scale_y_continuous(limits = c(0,1),
                     labels = scales::percent_format()) +
  annotate(geom = "text", x = 1.01:2.01, y = c(.1,.1), 
           label=c("73%","20%"),
           size=5,
           colour="white") +
  scale_fill_manual(values = c("violetred2","mediumpurple4"),
                    guide = FALSE) + #darkorchid4; purple4
  scale_colour_manual(values = c("violetred2","mediumpurple4"),
                    guide = FALSE) +
  xlab("") +
  ylab("percent of contract types for T&S employees") +
  theme_bw()

data %>% #pull(`HE provider`) %>% unique
  filter(`HE provider` == "Newcastle University" |
         `HE provider` == "The University of Edinburgh" |
         `HE provider` == "The University of York" |
         `HE provider` == "University of Durham") %>% 
  filter(`Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "Full-time",
         `Category Marker` == "Terms of employment",
         `Activity standard occupational classification` == "All") %>%
  group_by(`HE provider`,`Academic Year`) %>% 
  summarise(Total=sum(Number)) -> totals

data %>% #pull(`HE provider`) %>% unique
  #filter(`Academic Year` == "2018/19") %>% 
  filter(`HE provider` == "Newcastle University" |
         `HE provider` == "The University of Edinburgh" |
         `HE provider` == "The University of York" |
         `HE provider` == "University of Durham") %>% 
  filter(`Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "Full-time",
         `Category Marker` == "Terms of employment",
         `Activity standard occupational classification` == "All") %>%
  select(-c(UKPRN,
            `Country of HE provider`,
            `Region of HE provider`,
            `Mode of employment`,
            `Activity standard occupational classification`,
            `Category Marker`)) %>% 
  full_join(totals, by = c("HE provider", "Academic Year")) %>% 
  mutate(percent = (Number/Total)*100) %>% 
  ggplot(aes(x=`HE provider`,
             y=`percent`,
             fill=`Category`)) +
  geom_bar(stat = "identity", position = "stack") +
  #  stat_summary(geom = "bar", fun.y = `sum`, position = "stack") +
  scale_fill_manual(values = c("violetred2","mediumpurple4")) +
#  scale_y_continuous(scales::percent_format()) +
  transition_states(`Academic Year`,
                    transition_length = 2,
                    state_length = 1) +
  ggtitle("Academic Year: {closest_state}") +
  theme_bw()

data %>% 
  filter(`HE provider` != "Total",
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Terms of employment") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  group_by(`HE provider`,`Academic Year`) %>% 
  summarise(total = sum(Number)) -> total_termsOfEmployment

data %>% 
  filter(`HE provider` != "Total",
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Academic employment function") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  group_by(`HE provider`,`Academic Year`) %>% 
  summarise(total = sum(Number)) -> total_academicEmploymentFunction

data %>% 
  filter(`HE provider` != "Total",
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Contract levels") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  group_by(`HE provider`,`Academic Year`) %>% 
  summarise(total = sum(Number)) -> total_contractLevels

3.1 Terms of Employment

total_termsOfEmployment %>% 
  filter(total >= 2500) %>% 
  pull(`HE provider`) %>% unique()
##  [1] "Cardiff University"                                  
##  [2] "Coventry University"                                 
##  [3] "Imperial College of Science, Technology and Medicine"
##  [4] "King's College London"                               
##  [5] "Newcastle University"                                
##  [6] "Queen Mary University of London"                     
##  [7] "The Manchester Metropolitan University"              
##  [8] "The Open University"                                 
##  [9] "The University of Birmingham"                        
## [10] "The University of Bristol"                           
## [11] "The University of Cambridge"                         
## [12] "The University of Edinburgh"                         
## [13] "The University of Exeter"                            
## [14] "The University of Glasgow"                           
## [15] "The University of Leeds"                             
## [16] "The University of Liverpool"                         
## [17] "The University of Manchester"                        
## [18] "The University of Oxford"                            
## [19] "The University of Sheffield"                         
## [20] "The University of Southampton"                       
## [21] "The University of Warwick"                           
## [22] "University College London"                           
## [23] "University of Nottingham"                            
## [24] "University of the Arts, London"
total_termsOfEmployment %>% 
  filter(total >= 2500) %>% 
  pivot_wider(names_from = "Academic Year", values_from = "total") %>% 
  na.omit() %>% 
  pull(`HE provider`) -> unis
data %>% 
  filter(`HE provider` %in% unis,
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Terms of employment") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  left_join(total_termsOfEmployment, by = c("HE provider", "Academic Year")) %>% 
  mutate(percent = (Number/total)*100) %>% 
  filter(Category == "Fixed-term") %>% 
  group_by(`HE provider`) %>% 
  summarise(mean = mean(percent)) -> means
data %>% 
  filter(`HE provider` %in% unis,
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Terms of employment") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  left_join(total_termsOfEmployment, by = c("HE provider", "Academic Year")) %>% 
  mutate(percent = (Number/total)*100) %>% 
  full_join(means, by = "HE provider") %>% 
  mutate(`HE provider` = case_when(`HE provider`== "Imperial College of Science, Technology and Medicine" ~ 
                                     "Imperial College London",
                                   TRUE ~ `HE provider`),
         `HE provider` = as.factor(`HE provider`),
         `HE provider` = fct_reorder(`HE provider`, -mean),
         `Category` = as.factor(`Category`),
         `Category` = fct_relevel(`Category`, "Fixed-term", after = Inf)) %>% 
  ggplot(aes(x=`HE provider`,
             y=`percent`,
             fill=`Category`)) +
  geom_bar(stat = "identity", position = "stack") +
  #theme(axis.text.x = element_text(angle = 50, hjust = 1)) +
  scale_fill_manual(values = c("violetred2","mediumpurple4")) +
  transition_states(`Academic Year`,
                    transition_length = 1,
                    state_length = 3) +
  ggtitle("Academic Year: {closest_state}") +
  theme_bw() +
  coord_flip() +
  geom_hline(yintercept = 50)

3.2 Newcastle specific

data %>% 
  filter(`HE provider` == "Newcastle University",
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Terms of employment") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  left_join(total_termsOfEmployment, by = c("HE provider", "Academic Year")) %>% 
  mutate(percent = (Number/total)*100) %>% 
  mutate(`Category` = as.factor(`Category`),
         `Category` = fct_relevel(`Category`, "Fixed-term", after = Inf)) %>% 
  ggplot(aes(x=`Academic Year`,
             y=`percent`,
             fill=`Category`)) +
  geom_bar(stat = "identity", position = "stack") +
  #theme(axis.text.x = element_text(angle = 50, hjust = 1)) +
  scale_fill_manual(values = c("violetred2","mediumpurple4"))

3.3 Edinburgh specific

data %>% 
  filter(`HE provider` == "The University of Edinburgh",
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Terms of employment") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  left_join(total_termsOfEmployment, by = c("HE provider", "Academic Year")) %>% 
  mutate(percent = (Number/total)*100) %>% 
  mutate(`Category` = as.factor(`Category`),
         `Category` = fct_relevel(`Category`, "Fixed-term", after = Inf)) %>% 
  ggplot(aes(x=`Academic Year`,
             y=`percent`,
             fill=`Category`)) +
  geom_bar(stat = "identity", position = "stack") +
  #theme(axis.text.x = element_text(angle = 50, hjust = 1)) +
  scale_fill_manual(values = c("violetred2","mediumpurple4"))

3.4 Edinburgh specific

data %>% 
  filter(`HE provider` == "The University of Glasgow",
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Terms of employment") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  left_join(total_termsOfEmployment, by = c("HE provider", "Academic Year")) %>% 
  mutate(percent = (Number/total)*100) %>% 
  mutate(`Category` = as.factor(`Category`),
         `Category` = fct_relevel(`Category`, "Fixed-term", after = Inf)) %>% 
  ggplot(aes(x=`Academic Year`,
             y=`percent`,
             fill=`Category`)) +
  geom_bar(stat = "identity", position = "stack") +
  #theme(axis.text.x = element_text(angle = 50, hjust = 1)) +
  scale_fill_manual(values = c("violetred2","mediumpurple4"))

3.5 Academic Employment Function

total_academicEmploymentFunction %>% 
  filter(total >= 2500) %>% 
  pull(`HE provider`) %>% unique()
##  [1] "Cardiff University"                                  
##  [2] "Coventry University"                                 
##  [3] "Imperial College of Science, Technology and Medicine"
##  [4] "King's College London"                               
##  [5] "Newcastle University"                                
##  [6] "Queen Mary University of London"                     
##  [7] "The Manchester Metropolitan University"              
##  [8] "The Open University"                                 
##  [9] "The University of Birmingham"                        
## [10] "The University of Bristol"                           
## [11] "The University of Cambridge"                         
## [12] "The University of Edinburgh"                         
## [13] "The University of Exeter"                            
## [14] "The University of Glasgow"                           
## [15] "The University of Leeds"                             
## [16] "The University of Liverpool"                         
## [17] "The University of Manchester"                        
## [18] "The University of Oxford"                            
## [19] "The University of Sheffield"                         
## [20] "The University of Southampton"                       
## [21] "The University of Warwick"                           
## [22] "University College London"                           
## [23] "University of Nottingham"                            
## [24] "University of the Arts, London"
total_academicEmploymentFunction %>% 
  filter(total >= 2500) %>% 
  pivot_wider(names_from = "Academic Year", values_from = "total") %>% 
  na.omit() %>% 
  pull(`HE provider`) -> unis
data %>% 
  filter(`HE provider` %in% unis,
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Academic employment function") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  left_join(total_academicEmploymentFunction, by = c("HE provider", "Academic Year")) %>% 
  mutate(percent = (Number/total)*100) %>% 
  filter(Category == "Teaching only") %>% 
  group_by(`HE provider`) %>% 
  summarise(mean = mean(percent)) -> means_employ
data %>% 
  filter(`HE provider` %in% unis,
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Academic employment function") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  left_join(total_academicEmploymentFunction, by = c("HE provider", "Academic Year")) %>% 
  mutate(percent = (Number/total)*100) %>% 
  full_join(means_employ, by = "HE provider") %>% 
  mutate(`HE provider` = case_when(`HE provider`== "Imperial College of Science, Technology and Medicine" ~ 
                                     "Imperial College London",
                                   TRUE ~ `HE provider`),
         `HE provider` = as.factor(`HE provider`),
         `HE provider` = fct_reorder(`HE provider`, -mean),
         `Category` = as.factor(`Category`)) %>% 
  ggplot(aes(x=`HE provider`,
             y=`percent`,
             fill=`Category`)) +
  geom_bar(stat = "identity", position = "stack") +
  #theme(axis.text.x = element_text(angle = 50, hjust = 1)) +
  scale_fill_manual(values = c("darkturquoise","red","mediumpurple4","violetred2")) +
  transition_states(`Academic Year`,
                    transition_length = 1,
                    state_length = 3) +
  ggtitle("Academic Year: {closest_state}") +
  theme_bw() +
  coord_flip()

3.6 Contract levels

total_contractLevels %>% 
  filter(total >= 2500) %>% 
  pull(`HE provider`) %>% unique()
##  [1] "Cardiff University"                                  
##  [2] "Coventry University"                                 
##  [3] "Imperial College of Science, Technology and Medicine"
##  [4] "King's College London"                               
##  [5] "Newcastle University"                                
##  [6] "Queen Mary University of London"                     
##  [7] "The Manchester Metropolitan University"              
##  [8] "The Open University"                                 
##  [9] "The University of Birmingham"                        
## [10] "The University of Bristol"                           
## [11] "The University of Cambridge"                         
## [12] "The University of Edinburgh"                         
## [13] "The University of Exeter"                            
## [14] "The University of Glasgow"                           
## [15] "The University of Leeds"                             
## [16] "The University of Liverpool"                         
## [17] "The University of Manchester"                        
## [18] "The University of Oxford"                            
## [19] "The University of Sheffield"                         
## [20] "The University of Southampton"                       
## [21] "The University of Warwick"                           
## [22] "University College London"                           
## [23] "University of Nottingham"                            
## [24] "University of the Arts, London"
total_contractLevels %>% 
  filter(total >= 2500) %>% 
  pivot_wider(names_from = "Academic Year", values_from = "total") %>% 
  na.omit() %>% 
  pull(`HE provider`) -> unis
data %>% 
  filter(`HE provider` %in% unis,
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Contract levels") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  left_join(total_contractLevels, by = c("HE provider", "Academic Year")) %>% 
  mutate(percent = (Number/total)*100) %>% 
  filter(Category == "Professor") %>% 
  group_by(`HE provider`) %>% 
  summarise(mean = mean(percent)) -> means_contract
data %>% 
  filter(`HE provider` %in% unis,
         `Country of HE provider` == "All",
         `Region of HE provider` == "All",
         `Mode of employment` == "All",
         `Activity standard occupational classification` == "All",
         `Category Marker` == "Contract levels") %>% 
  select(`HE provider`,`Academic Year`,Category,Number) %>% 
  left_join(total_contractLevels, by = c("HE provider", "Academic Year")) %>% 
  mutate(percent = (Number/total)*100) %>% 
  full_join(means_contract, by = "HE provider") %>% 
  mutate(`HE provider` = case_when(`HE provider`== "Imperial College of Science, Technology and Medicine" ~ 
                                     "Imperial College London",
                                   TRUE ~ `HE provider`),
         `HE provider` = as.factor(`HE provider`),
         `HE provider` = fct_reorder(`HE provider`, -mean),
         `Category` = as.factor(`Category`),
         `Category` = fct_relevel(`Category`, rev)) %>% 
  ggplot(aes(x=`HE provider`,
             y=`percent`,
             fill=`Category`)) +
  geom_bar(stat = "identity", position = "stack") +
  #theme(axis.text.x = element_text(angle = 50, hjust = 1)) +
  scale_fill_manual(values = c("mediumpurple4","darkturquoise","violetred2")) +
  transition_states(`Academic Year`,
                    transition_length = 1,
                    state_length = 3) +
  ggtitle("Academic Year: {closest_state}") +
  theme_bw() +
  coord_flip()